﻿using UnityEngine;
using System.Collections;

public class MetumAbsorb_Transfer : MonoBehaviour
{
    new Rigidbody2D rigidbody2D;
    private void Awake()
    {
        rigidbody2D = GetComponent<Rigidbody2D>();
    }
    private void OnCollisionEnter2D(Collision2D collision)
    {
        if (collision.rigidbody != null)
        {
            
            rigidbody2D.velocity += collision.rigidbody.velocity * collision.rigidbody.mass / rigidbody2D.mass;
            print(collision.transform);
            collision.rigidbody.velocity = Vector2.zero;
        }
    }
}
